<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="includes/head.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Basket</title>
</head>
<body>
	<span id="whole-page-wrapper">
			<div id="wrapper" align="center">
			<%@include file="includes/header.jsp" %>
			<%@include file="includes/menu.jsp" %>	
					
				<div id="content">
					<div id="inner-content">
					<c:if test="${sessionScope.user.type == 'User' }">
							<c:if test="${sessionScope.cart != null }">
								<c:if test="${sessionScope.cart.size() > 0 }">
								<h4> Koszyk: </h4>
								<%! int i=0; %>
									<c:forEach var="product" items="${sessionScope.cart}"> 
										<span class="leftIndent30px"> <%= (i+1) %>. ${product.model } 
											<form action="removeFromCart" method="POST">
											<input type="hidden" name="index" value="<%= i %>" />
											<input type="submit" value="usuń">
											</form> 
										</span>
										<% i++; %>
										<br><br><br>
									</c:forEach>
									<% i=0; %>
									<br>
									<form action="addOrder" method="POST">
									<input type="submit" value="Zamawiam">
									</form>
								</c:if>
							</c:if>
							<c:if test="${sessionScope.cart == null }">
								Koszyk jest pusty
							</c:if>
							<c:if test="${sessionScope.cart.size() == 0 }">
								Koszyk jest pusty
							</c:if>
					</c:if>
					<c:if test="${sessionScope.user.type != 'User' }">
						Nie masz uprawnień do korzystania z tej strony!
					</c:if>
					</div>
				</div>
				<%@include file="includes/footer.jsp" %>
			</div>
		</span>
</body>
</html>